1. Field of the Invention
The present invention relates in general to the field of computers and similar technologies, and in particular to software utilized in this field. Still more particularly, it relates to a method, system, and computer usable medium for managing prefetch streams in a virtual machine environment.
2. Description of the Related Art
Prefetching is a known approach in conventional computing systems for lessening the effects of memory access latency, which can adversely affect the performance of applications on modern processors. Rather than waiting for a cache miss to initiate a memory fetch, data prefetching anticipates such misses and issues a fetch to the memory system in advance of the actual memory reference. Data prefetching can be accomplished by software alone, hardware alone or a combination of the two. Software prefetching relies on compile-time analysis to insert and schedule prefetch, or touch, instructions within user programs. But prefetch instructions themselves involve some overhead. Hardware-based prefetching employs special hardware which monitors the storage reference patterns of the application in an attempt to infer prefetching opportunities. It has no instruction overhead, but it is often less accurate than software prefetching because it speculates on future memory accesses without the benefit of compile-time information. The combination of software and hardware prefetching is designed to take advantage of compile-time program information so as to direct the hardware prefetcher while incurring the least amount of software overhead as possible.
Stream prefetching provides an efficient use of resources in processors and processing systems. When sequential access to two or more adjacent locations is detected, one or more additional cache lines can be prefetched from lower levels of a memory hierarchy in order to attempt to have data and/or instructions ready for use by the processor as they are needed. A “stream” is a contiguous set of cache lines containing instructions or data, or in some specialized processor architectures, instructions and data.
It is not uncommon for hardware data prefetching to be disabled in some software applications and have the application itself initiate prefetch streams. However, if the steam cannot be established in the hardware due to a lack of available prefetch machines, or due to initiated prefetches being terminated, or slow execution due to too many instructions in the core, the software application may have already moved on to other instructions. Currently, there is no known method to re-instantiate the stream to prefetch data as expected by the application. In view of the foregoing, there is a need for a method in a virtual machine environment for the Hypervisor and operating system kernel to re-instantiate the stream such that the data can be prefetched as expected by the application.